* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    background-color: #343541;
    color: #fff;
    overflow: hidden;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: none;
    margin: 0;
    position: relative;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    gap: 24px;
    max-width: 100%;
    padding-bottom: 100px;
}

.message {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 12px;
    position: relative;
    line-height: 1.8;
    min-width: 120px;
    max-width: 85%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.user-message {
    margin-left: auto;
    margin-right: 24px;
    background-color: #444654;
    border: 1px solid #565869;
    text-align: left;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.user-message::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid #444654;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.user-message::before {
    content: '';
    position: absolute;
    right: -11px;
    top: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid #565869;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    z-index: -1;
}

.user-message code:not(pre code) {
    background: #2a2b32;
    color: #7aa2f7;
    padding: 2px 6px;
}

.user-message a {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.5);
}

.user-message a:hover {
    text-decoration-color: #ffffff;
}

.user-message blockquote {
    border-left-color: #7aa2f7;
    background-color: #2a2b32;
    color: #a9adc1;
}

.user-message .message-time {
    color: #8e8ea0;
    text-align: right;
}

.assistant-message {
    margin-right: auto;
    margin-left: 24px;
    background-color: #444654;
    border: 1px solid #565869;
    text-align: left;
}

.assistant-message::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 20px;
    width: 0;
    height: 0;
    border-right: 10px solid #444654;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.assistant-message::before {
    content: '';
    position: absolute;
    left: -11px;
    top: 20px;
    width: 0;
    height: 0;
    border-right: 10px solid #565869;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    z-index: -1;
}

.input-container {
    padding: 20px 24px;
    background-color: #343541;
    border-top: 1px solid #565869;
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
}

textarea {
    flex: 1;
    padding: 14px 18px;
    min-height: 24px;
    max-height: 200px;
    border: 1px solid #565869;
    border-radius: 12px;
    background-color: #3a3b47;
    color: #fff;
    resize: none;
    font-size: 15px;
    line-height: 1.6;
    transition: all 0.3s ease;
    overflow-y: hidden;
}

textarea:focus {
    outline: none;
    border-color: #565869;
    background-color: #40414f;
}

.input-container button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 40px;
    padding: 0 20px;
    border-radius: 12px;
    background-color: #444654;
    border: 1px solid #565869;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.input-container button:hover {
    background-color: #40414f;
    border-color: #565869;
    transform: none;
}

.input-container button:disabled {
    background-color: #343541;
    border-color: #565869;
    color: #8e8ea0;
}

button:not(.input-container button):not(.copy-button):not(.chat-action-button):not(.menu-button):not(.settings-button):not(.clear-all-button):not(.close-button):not(.retry-button):not(.confirm-actions button) {
    display: none;
}

/* 优化滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #565869;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #7aa2f7;
}

/* 代码块样式 */
pre {
    background-color: #1a1b26;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
    position: relative;
    border: 1px solid #2f3042;
}

code {
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* 复制按钮 */
.copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 13px;
    background: #2a2b32;
    border: 1px solid #565869;
    color: #8e8ea0;
    opacity: 0;
    transition: all 0.2s ease;
    position: absolute;
    right: 8px;
    top: 8px;
    border-radius: 6px;
    cursor: pointer;
    gap: 4px;
}

.copy-button::before {
    content: '📋';
    font-size: 14px;
}

.copy-button:hover {
    background-color: #40414f;
    border-color: #565869;
    color: #fff;
}

.copy-button.copied {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
}

.copy-button.copied::before {
    content: '✓';
}

pre:hover .copy-button {
    opacity: 1;
}

/* 加载动画 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px;
    background: #444654;
    border-radius: 8px;
    margin: 8px 0;
    justify-content: flex-start;
    order: 999;
}

/* 闪烁光标动画 */
.typing-indicator::after {
    content: '▋';
    color: #fff;
    font-size: 20px;
    animation: blink 1s steps(2) infinite;
    opacity: 0.8;
    position: relative;
    top: 2px;
}

@keyframes blink {
    0% {
        opacity: 0.8;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 0.8;
    }
}

/* 移除旧的点动画相关样式 */
.typing-dot {
    display: none;
}

/* 打字机效果 */
@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

.typing-effect {
    display: inline-block;
    overflow: hidden;
    border-right: 2px solid #fff;
    white-space: pre-wrap;
    animation:
        typing 0.5s steps(30, end),
        blink 1s step-end infinite;
}

/* 时间戳样式 */
.message-time {
    font-size: 12px;
    color: #8e8ea0;
    margin-top: 8px;
    margin-bottom: -4px;
}

/* Markdown 样式优化 */
.message p {
    margin-bottom: 12px;
    line-height: 1.8;
}

.message ul,
.message ol {
    margin: 16px 0;
    padding-left: 24px;
}

.message li {
    margin-bottom: 8px;
}

.message blockquote {
    border-left: 4px solid #7aa2f7;
    margin: 16px 0;
    padding: 8px 0 8px 16px;
    color: #a9adc1;
    background-color: #2a2b32;
    border-radius: 4px;
}

.message code:not(pre code) {
    background: #2a2b32;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #7aa2f7;
    word-break: break-word;
    white-space: pre-wrap;
}

/* 代码块样式优化 */
.message pre {
    margin: 16px -20px;
    padding: 16px 20px;
    background-color: #1a1b26;
    border-radius: 8px;
    overflow-x: auto;
    width: calc(100% + 40px);
    min-width: 0;
    border: 1px solid #2f3042;
}

.message pre:first-child {
    margin-top: 0;
}

.message pre:last-child {
    margin-bottom: 0;
}

.message pre code {
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 0;
    background: transparent;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 滚动条样式优化 */
pre::-webkit-scrollbar {
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: #2a2b32;
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
    background: #565869;
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: #666876;
}

/* 添加应用容器样式 */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* 基础侧边栏样式 */
.sidebar {
    width: 260px;
    min-width: 260px;
    background-color: #202123;
    border-right: 1px solid #565869;
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 12px;
    height: 100vh;
    overflow-y: auto;
}

/* 会话列表基础样式 */
.chat-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 会话项基础样式 */
.chat-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    font-size: 14px;
    border: 1px solid transparent;
    background-color: transparent;
    min-height: 44px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.chat-item .chat-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
    transition: color 0.2s ease;
}

.chat-item .chat-actions {
    display: flex;
    gap: 8px;
    margin-left: 8px;
}

/* PC端特定样式 */
@media (min-width: 769px) {
    .chat-item .chat-actions {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease;
    }

    .chat-item:hover .chat-actions {
        opacity: 1;
        visibility: visible;
    }
}

/* 移动端样式 */
@media (max-width: 768px) {

    /* 主容器布局调整 */
    .chat-container {
        padding-top: 60px;
        /* 为顶部栏留出空间 */
    }

    /* 顶部栏样式 */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 52px;
        background-color: #343541;
        border-bottom: 1px solid #565869;
        display: flex;
        align-items: center;
        padding: 0 16px;
        z-index: 1000;
    }

    /* 汉堡菜单按钮 */
    .menu-button {
        display: flex !important;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        border-radius: 6px;
        align-items: center;
        justify-content: center;
    }

    .menu-icon {
        width: 20px;
        height: 2px;
        background: #fff;
        position: relative;
    }

    .menu-icon::before,
    .menu-icon::after {
        content: '';
        position: absolute;
        width: 20px;
        height: 2px;
        background: #fff;
        left: 0;
    }

    .menu-icon::before {
        top: -6px;
    }

    .menu-icon::after {
        bottom: -6px;
    }

    /* 当前会话标题 */
    .current-chat-title {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 16px;
        font-weight: 500;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60%;
        /* 限制最大宽度，防止遮挡按钮 */
        text-align: center;
    }

    /* 侧边栏样式 */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        z-index: 1000;
        background-color: #202123;
        padding: 60px 12px 12px 12px;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 8px rgba(0, 0, 0, 0.2);
    }

    /* 会话项样式 */
    .chat-item {
        width: 100%;
        min-height: 48px;
        padding: 8px 12px;
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        position: relative;
        background-color: transparent;
        border-radius: 8px;
        box-sizing: border-box;
        cursor: pointer;
    }

    .chat-item:active {
        background-color: #343541;
    }

    .chat-item.active {
        background-color: #343541;
        border: 1px solid #565869;
    }

    /* 话标题样式 */
    .chat-item .chat-title {
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-right: 80px;
        color: #fff;
    }

    /* 操作按钮容器 */
    .chat-item .chat-actions {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        gap: 8px;
        background-color: #202123;
        padding-left: 8px;
        z-index: 3;
    }

    /* 编辑状态的会话项 */
    .chat-item.editing {
        padding: 8px 12px;
    }

    .chat-item.editing .chat-title-input {
        width: calc(100% - 90px);
        height: 36px;
        background-color: #40414f;
        border: 1px solid #565869;
        border-radius: 6px;
        color: #fff;
        font-size: 14px;
        padding: 0 8px;
        position: relative;
        z-index: 2;
    }

    /* 操作按钮样式 */
    .chat-action-button {
        width: 36px;
        height: 36px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: #8e8ea0;
        border-radius: 4px;
        cursor: pointer;
    }

    .chat-action-button:active {
        background-color: #40414f;
        color: #fff;
    }

    /* 遮罩层样式 */
    .overlay {
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
    }

    .overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* 通用按钮样式 */
.chat-action-button {
    padding: 4px;
    background: transparent;
    border: none;
    color: #8e8ea0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.chat-action-button:hover {
    background: #40414f;
    color: #fff;
}

/* 新建会话按钮 */
.new-chat-button {
    display: flex !important;
    width: 100%;
    padding: 12px;
    background-color: #343541;
    border: 1px solid #565869;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
}

.new-chat-button:hover {
    background-color: #40414f;
    border-color: #8e8ea0;
}

/* 重命名输入框基础样式 */
.chat-title-input {
    width: calc(100% - 90px);
    background: #40414f;
    border: 1px solid #565869;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    padding: 4px 8px;
}

/* 部栏基础样式 */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background-color: #343541;
    border-bottom: 1px solid #565869;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
}

/* 当前会话标题 */
.current-chat-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
    /* 限制最大宽度，防止遮挡按钮 */
    text-align: center;
}

/* 汉堡菜单按钮 */
.menu-button {
    position: relative;
    z-index: 2;
}

/* PC端特定样式 */
@media (min-width: 769px) {
    .mobile-header {
        left: 260px;
        /* 侧边栏宽度 */
    }

    .menu-button {
        display: none !important;
    }

    .chat-container {
        padding-top: 60px;
    }
}

/* 移动端样式 */
@media (max-width: 768px) {
    .chat-container {
        padding-top: 60px;
    }

    /* 汉堡菜单按钮 */
    .menu-button {
        display: flex !important;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        border-radius: 6px;
        align-items: center;
        justify-content: center;
    }

    .menu-icon {
        width: 20px;
        height: 2px;
        background: #fff;
        position: relative;
    }

    .menu-icon::before,
    .menu-icon::after {
        content: '';
        position: absolute;
        width: 20px;
        height: 2px;
        background: #fff;
        left: 0;
    }

    .menu-icon::before {
        top: -6px;
    }

    .menu-icon::after {
        bottom: -6px;
    }
}

/* 设置按钮样式 */
.settings-button {
    display: flex !important;
    width: 100%;
    padding: 12px;
    background-color: transparent;
    border: 1px solid #565869;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    margin-bottom: 12px;
}

.settings-button:hover {
    background-color: #40414f;
    border-color: #8e8ea0;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #2a2b32;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* 设置页面滚动条样式 */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #202123;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #565869;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #666876;
}

/* 优化设置组件布局 */
.modal-body {
    padding: 24px;
}

.settings-group {
    margin-bottom: 28px;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-group label {
    display: block;
    color: #fff;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

/* 优化滑块容器样式 */
.slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

/* 优化数值显示 */
.slider-container span {
    min-width: 48px;
    color: #8e8ea0;
    font-size: 14px;
    text-align: right;
}

/* 优化滑块样式 */
.slider-container input[type="range"] {
    flex: 1;
    height: 4px;
    background-color: #565869;
    border-radius: 2px;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background-color: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    background-color: #7aa2f7;
    transform: scale(1.1);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #565869;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: #fff;
}

.close-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #8e8ea0;
    cursor: pointer;
    border-radius: 6px;
}

.close-button:hover {
    background-color: #40414f;
    color: #fff;
}

/* 消息内容容器 */
.message-content {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    min-width: 0;
}

/* 加载动画优化 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px;
    background: #444654;
    border-radius: 8px;
    margin: 8px 0;
    justify-content: flex-start;
    order: 999;
}

/* 移除之前的头像相关样式 */
.message::before,
.user-message::before,
.assistant-message::before,
.typing-indicator::before {
    display: none;
}

/* 活动会话项样式 */
.chat-item.active {
    background-color: #343541;
    border-color: #565869;
}

/* 会话项悬停效果 */
.chat-item:hover:not(.active) {
    background-color: #2a2b32;
}

/* 活动会话项左边框高亮 */
.chat-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #7aa2f7;
    border-radius: 0 2px 2px 0;
}

/* 活动会话项的操作按钮样式 */
.chat-item.active .chat-action-button {
    color: #fff;
}

.chat-item.active .chat-action-button:hover {
    background-color: #40414f;
}

/* 会话标题样式优化 */
.chat-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
    transition: color 0.2s ease;
}

.chat-item.active .chat-title {
    color: #fff;
    font-weight: 500;
}

.chat-item:not(.active) .chat-title {
    color: #8e8ea0;
}

/* 错误模态框样式 */
.error-modal {
    max-width: 480px !important;
}

.error-modal .modal-header h2 {
    color: #ff4444;
}

.error-modal .modal-body {
    color: #fff;
}

.error-modal ol {
    margin: 16px 0;
    padding-left: 20px;
}

.error-modal li {
    margin-bottom: 12px;
    line-height: 1.5;
}

.error-modal a {
    color: #7aa2f7;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.error-modal a:hover {
    border-bottom-color: #7aa2f7;
    opacity: 0.8;
}

.error-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

.retry-button {
    display: flex !important;
    padding: 8px 16px;
    background-color: #7aa2f7;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-button:hover {
    background-color: #5d8ef7;
}

/* 确认对话框样式 */
.confirm-modal {
    max-width: 400px !important;
}

.confirm-modal .modal-body {
    text-align: center;
    padding: 24px;
}

.confirm-modal p {
    color: #fff;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 0;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.confirm-actions button {
    display: flex !important;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-button {
    background-color: transparent;
    border: 1px solid #565869;
    color: #8e8ea0;
}

.cancel-button:hover {
    background-color: #40414f;
    border-color: #8e8ea0;
    color: #fff;
}

.confirm-button {
    background-color: #ff4444;
    border: none;
    color: #fff;
}

.confirm-button:hover {
    background-color: #ff6666;
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #28a745;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 3000;
    animation: toast-in 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.hide {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    to {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
}

/* 优化设置页面样式 */
.settings-group {
    background-color: #343541;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #565869;
}

.settings-group .description {
    color: #8e8ea0;
    font-size: 13px;
    margin: 8px 0 12px;
    line-height: 1.5;
}

.settings-group label {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}

.settings-group select {
    width: 100%;
    padding: 10px 12px;
    background-color: #2a2b32;
    border: 1px solid #565869;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.settings-group select:hover {
    border-color: #8e8ea0;
}

.settings-group select:focus {
    outline: none;
    border-color: #7aa2f7;
}

/* 清空所有会话按钮样式 */
.clear-all-button {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #343541;
    border: 1px solid #565869;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    /* 使文本居中 */
}

/* 清空所有会话按钮样式 */
.clear-all-button svg {
    width: 16px;
    /* 设置 SVG 图标的宽度 */
    height: 16px;
    /* 设置 SVG 图标的高度 */
    margin-right: 8px;
    /* 添加右边距以分隔文本 */
}

.clear-all-button:hover {
    background-color: #40414f;
    border-color: #8e8ea0;
}

/* 短消息优化 */
.message:empty {
    display: none;
}

.message p:last-child {
    margin-bottom: 0;
}

/* 长链接文本处理 */
.message a {
    word-break: break-all;
    /* 确保长链接可以换行 */
}

/* 图片适应容器宽度 */
.message img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 修改行内代码样式 */
.message code:not(pre code) {
    background: #2a2b32;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #7aa2f7;
    word-break: break-word;
    white-space: pre-wrap;
}

/* 添加文件信息区域样式 */
.file-info-container {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    padding: 12px 24px;
    background-color: #2a2b32;
    border-top: 1px solid #565869;
    border-bottom: 1px solid #565869;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    animation: slideUp 0.3s ease;
    transform-origin: bottom;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #8e8ea0;
}

/* 文件操作按钮组 */
.file-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* 文件操作按钮 */
.file-action-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background-color: transparent;
    border: 1px solid #565869;
    border-radius: 6px;
    color: #8e8ea0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.file-action-button:hover {
    background-color: #40414f;
    border-color: #8e8ea0;
    color: #fff;
}

.file-action-button.remove {
    color: #ff4444;
    border-color: #ff4444;
}

.file-action-button.remove:hover {
    background-color: #ff4444;
    color: #fff;
}

/* 文件图标 */
.file-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #40414f;
    border-radius: 6px;
    color: #7aa2f7;
    font-size: 18px;
}

/* 文件类型标签 */
.file-type {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    background-color: #40414f;
    border-radius: 4px;
    font-size: 12px;
    color: #8e8ea0;
}

/* 文件大小标签 */
.file-size {
    color: #8e8ea0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .file-info-container {
        padding: 12px 16px;
        bottom: 70px;
    }

    .file-actions {
        flex-shrink: 0;
    }

    .file-name {
        max-width: 200px;
    }
}

/* 文件上传按钮样式优化 */
.upload-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: transparent;
    border: none;
    color: #8e8ea0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-button:hover {
    background-color: #40414f;
    color: #fff;
}

/* 拖拽上传区域样式 */
.drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.drag-overlay.active {
    display: flex;
}

.drag-message {
    padding: 40px;
    border: 2px dashed #565869;
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    background: rgba(64, 65, 79, 0.9);
    text-align: center;
}

/* 文件信息区域样式 */
.file-info-container {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    padding: 12px 24px;
    background-color: #2a2b32;
    border-top: 1px solid #565869;
    border-bottom: 1px solid #565869;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    animation: slideUp 0.3s ease;
    transform-origin: bottom;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #8e8ea0;
}

/* 文件操作按钮组 */
.file-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* 文件操作按钮 */
.file-action-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background-color: transparent;
    border: 1px solid #565869;
    border-radius: 6px;
    color: #8e8ea0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.file-action-button:hover {
    background-color: #40414f;
    border-color: #8e8ea0;
    color: #fff;
}

.file-action-button.remove {
    color: #ff4444;
    border-color: #ff4444;
}

.file-action-button.remove:hover {
    background-color: #ff4444;
    color: #fff;
}

/* 文件图标 */
.file-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #40414f;
    border-radius: 6px;
    color: #7aa2f7;
    font-size: 18px;
}

/* 文件类型标签 */
.file-type {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    background-color: #40414f;
    border-radius: 4px;
    font-size: 12px;
    color: #8e8ea0;
}

/* 文件大小标签 */
.file-size {
    color: #8e8ea0;
}

/* 重命名弹窗样式优化 */
.rename-modal {
    max-width: 400px;
}

.rename-modal .rename-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 24px;
    background-color: #40414f;
    border: 1px solid #565869;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.rename-modal .rename-input:focus {
    outline: none;
    border-color: #7aa2f7;
    box-shadow: 0 0 0 2px rgba(122, 162, 247, 0.2);
}

.rename-modal .rename-input::placeholder {
    color: #8e8ea0;
}

.rename-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.rename-modal .modal-actions button {
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.rename-modal .cancel-button {
    background-color: transparent;
    border: 1px solid #565869;
    color: #8e8ea0;
}

.rename-modal .cancel-button:hover {
    background-color: #40414f;
    border-color: #8e8ea0;
    color: #fff;
}

.rename-modal .confirm-button {
    background-color: #7aa2f7;
    border: none;
    color: #fff;
}

.rename-modal .confirm-button:hover {
    background-color: #5d8ef7;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .rename-modal {
        width: calc(100% - 32px);
        margin: 0 16px;
    }

    .rename-modal .modal-actions button {
        flex: 1;
        text-align: center;
    }
}

/* 基础URL输入框样式 */
.settings-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    background-color: #2a2b32;
    border: 1px solid #565869;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-top: 8px;
    margin-bottom: 8px;
}

.settings-group input[type="text"]:hover {
    border-color: #8e8ea0;
}

.settings-group input[type="text"]:focus {
    outline: none;
    border-color: #7aa2f7;
    box-shadow: 0 0 0 2px rgba(122, 162, 247, 0.2);
}

.settings-group input[type="text"]::placeholder {
    color: #8e8ea0;
}

/* 优化设置组的间距 */
.settings-group {
    background-color: #343541;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #565869;
}

.settings-group:first-child {
    margin-top: 0;
}

.settings-group label {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}

.settings-group .description {
    color: #8e8ea0;
    font-size: 13px;
    margin: 8px 0;
    line-height: 1.5;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .settings-group input[type="text"] {
        font-size: 16px;
        /* 防止iOS自动缩放 */
        padding: 12px;
    }
}

/* 错误状态样式 */
.settings-group input[type="text"].error {
    border-color: #ff4444;
    background-color: rgba(255, 68, 68, 0.1);
}

.settings-group input[type="text"].error:focus {
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.2);
}

/* 成功状态样式 */
.settings-group input[type="text"].success {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.settings-group input[type="text"].success:focus {
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

/* 优化侧边栏滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #565869;
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #7aa2f7;
}

/* 优化聊天列表滚动条样式 */
.chat-list::-webkit-scrollbar {
    width: 6px;
}

.chat-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-list::-webkit-scrollbar-thumb {
    background: #565869;
    border-radius: 10px;
}

.chat-list::-webkit-scrollbar-thumb:hover {
    background: #7aa2f7;
}

/* 确保滚动条不占用额外空间 */
.sidebar,
.chat-list {
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: #565869 transparent;
    /* Firefox */
}

/* 优化移动端滚动体验 */
@media (max-width: 768px) {

    .sidebar,
    .chat-list {
        -webkit-overflow-scrolling: touch;
        /* iOS 滚动优化 */
    }
}